package com.example.radiationarea.config;

import net.minecraftforge.common.ForgeConfigSpec;
import org.apache.commons.lang3.tuple.Pair;

import java.util.List;

public class ModConfigs {
    public static class Server {
        public final ForgeConfigSpec.ConfigValue<List<? extends String>> radiationSuitItems;

        Server(ForgeConfigSpec.Builder builder) {
            builder.comment("Server configuration settings for Radiation Area mod")
                   .push("server");

            radiationSuitItems = builder
                    .comment("List of additional item IDs that provide radiation protection. ",
                            "Note: Items from Zombie Extansion mod are supported by default and don't need to be added here.",
                            "Format: modid:item_name",
                            "Example: example_mod:radiation_helmet")
                    .translation("radiation_area.config.server.radiationSuitItems")
                    .defineList("radiationSuitItems", 
                            List.of(), // Default empty list
                            obj -> obj instanceof String);

            builder.pop();
        }
    }

    public static final ForgeConfigSpec SERVER_SPEC;
    public static final Server SERVER;

    static {
        final Pair<Server, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(Server::new);
        SERVER = specPair.getLeft();
        SERVER_SPEC = specPair.getRight();
    }
}